/**
 *
 */
package com.aliyun.messagemgt.common.errorcode;


/**
 * @author wucong
 *
 * 2018年4月17日
 */
public enum CommonErrorCode implements IErrorCode {
    //错误码
    COMMON_PARAM_INVALID(1001, "参数非法"),

    COMMON_DATABASE_TYPE_ERROR(1002, "数据库类型错误"),

    CHANNEL_NO_OFF_MSG(11010, "该渠道已被消息源占用，请先解除关联后重试！"),

    OPERATION_ERROR(9999, "操作失败"),

    COMMON_PARAM_TYPE_ERROR(1003, "参数类型错误"),

    COMMON_PARAM_MISSING(1004, "参数缺失"),

    COMMON_IDENTIFIED_MISSING(1005, "身份缺失"),

    COMMON_IDENTIFIED_ERROR(1006, "身份错误,越权操作"),

    COMMON_OVER_AUTHORITY(1007, "越权操作,请申请权限后重试"),

    COMMON_WO_ERROE(1008, "流程发生错误"),

    COMMON_SLS_ERROR(1009, "SLS日志查询出错"),
	
	COMMON_DATASCOURCE_NAME_REPEAT_ERROR(1010,"此数据源名称已存在，请重新填写"),
	
	COMMON_DATASCOURCE_CONFIG_REPEAT_ERROR(1011,"存在配置相同的数据源"),
	
	COMMON_DATASCOURCE_SAVE_ERROR(1012,"保存数据源失败"),
	
	COMMON_DATASCOURCE_SAVE_PLANING_ERROR(1013,"此数据源已在场景中使用，不可直接删除"),
	
	COMMON_DATASCOURCE_UPADTE_PLANING_UPDATE_ERROR(1014,"据源已配置计划并审核通过，更新不可更新连接信息，只能更新名称和描述"),
	
	COMMON_DATASCOURCE_TESTCONNECTION_FAIL(1015,"连通性测试失败"),

    COMMON_MESSAGE_TEMPLATE_NAME_ERROR(1016,"此消息模板名称已存在，请重新填写"),

    COMMON_TEMPLATE_TITLE_ERROR(1018,"此消息模板标题已经存在，请重新填写"),

    COMMON_MESSAGE_TEMPLATE_DELETE_ERROR(1017,"删除失败，该消息模板正在使用"),

    FOURA_NULL_ASSERTION(2001,"4A assertion 为空"),

    FOURA_NULL_PRINCIPAL(2002,"4A rincipal 为空"),

    FOURA_NO_USERINFO(2003,"4A 无法获取该用户详细信息"), 
    
    FAIL_UPDATE_PENDING(3001,"更新待办事项失败"),
    
    FAIL_UPDATE_MSGSOURCE(3002,"更新消息源失败"),

    FAIL_UPDATE_MSGTEMPLATE(3010,"更新消息模板失败"),
	
	//COMMON_MSGSCOURCE_NAME_REPEAT_ERROR(1010,"存在消息源名称相同的消息源，请重新输入消息源名称"),
	
	FAIL_DEL_MSGSOURCE(3003,"消息源删除失败"),

	COMMON_MSGSCOURCE_NAME_REPEAT_ERROR(1010,"发送任务名称重复，请重新填写"),

    FAIL_SAVE_PUSHCHANNEL(4001,"该名称已存在，请重新输入"),

    FAIL_SAVE_MONITORINFO(5001,"该监控名称已存在，请重新输入"),

    FAIL_SAVE_MONITORINFO_EXIST(5002,"数据库已存在该监控，请重新确认"),

    FAIL_DELETE(6001,"删除失败"),

    FAIL_INSERT(6002,"添加失败"),

    FAIL_UPDATE(7001,"更新失败"),

    FAIL_USER_LABEL(7002,"请添加标签用户之后再启用"),

    EXCEL_UPDATE(8001,"导入失败"),

    FILE_TYPE_FAIL(8002,"文件格式错误"),

    FILE_FAIL(8002,"请按照模板格式输入"),

    MOBILE_TYPE_ERROR(8003,"手机号格式错误"),

    EMAIL_TYPE_ERROR(8003,"邮箱格式错误"),

	NO_POWER_TOUPDATE(9001,"无修改权限"),

	INSUFFICIENT_TOTAL_DOWNLOADS(9002,"总下载次数已经用完"),

    INSUFFICIENT_TODAY_DOWNLOADS(9002,"当日下载次数已经用完"),

    /************************操作日志begin******************************/
    SUCCESS_ADD_SOURCE(100001,"新增消息源成功"),

    FAIL_ADD_SOURCE(100002,"新增消息源失败"),

    SUCCESS_UPDATE_SOURCE(100003,"编辑消息源成功"),

    FAIL_UPDATE_SOURCE(100004,"编辑消息源失败"),

    SUCCESS_PUBLISH_SOURCE(100005,"申请发布消息源成功"),

    FAIL_PUBLISH_SOURCE(100006,"申请发布消息源失败"),

    SUCCESS_DELETE_SOURCE(100007,"删除消息源成功"),

    FAIL_DELETE_SOURCE(100008,"删除消息源失败"),

    SUCCESS_OFFLINE_SOURCE(100009,"下线消息源成功"),

    FAIL_OFFLINE_SOURCE(100010,"下线消息源失败"),

    SUCCESS_ADD_CHANNEL(100011,"新增渠道成功"),

    FAIL_ADD_CHANNEL(100012,"新增渠道失败"),

    SUCCESS_UPDATE_CHANNEL(100013,"编辑渠道成功"),

    FAIL_UPDATE_CHANNEL(100014,"编辑渠道失败"),

    SUCCESS_PUBLISH_CHANNEL(100015,"提交渠道成功"),

    FAIL_PUBLISH_CHANNEL(100016,"提交渠道失败"),

    SUCCESS_DELETE_CHANNEL(100017,"删除渠道成功"),

    FAIL_DELETE_CHANNEL(100018,"删除渠道失败"),

    PUSH_CHANNEL_CODE__ISNULL(100019, "渠道编码为空"),

    SUCCESS_ADD_TEMPLATE(100021,"新增模板成功"),

    FAIL_ADD_TEMPLATE(100022,"新增模板失败"),

    SUCCESS_UPDATE_TEMPLATE(100023,"编辑模板成功"),

    FAIL_UPDATE_TEMPLATE(100024,"编辑模板失败"),

    SUCCESS_PUBLISH_TEMPLATE(100025,"提交模板成功"),

    FAIL_PUBLISH_TEMPLATE(100026,"提交模板失败"),

    SUCCESS_DELETE_TEMPLATE(100027,"删除模板成功"),

    FAIL_DELETE_TEMPLATE(100028,"删除模板失败"),

    SUCCESS_OFFLINE_TEMPLATE(100029,"下线模板成功"),

    FAIL_OFFLINE_TEMPLATE(100030,"下线模板失败"),

    SUCCESS_UPDATE_QUOTA(100031,"编辑短信配额成功"),

    FAIL_UPDATE_QUOTA(100032,"编辑短信配额失败"),

    SUCCESS_DEFAULT_QUOTA(100033,"编辑默认短信配额成功"),

    FAIL_DEFAULT_QUOTA(100034,"编辑默认短信配额失败"),

    SUCCESS_ADD_MONITOR(100041,"新增监控成功"),

    FAIL_ADD_MONITOR(100042,"新增监控失败"),

    SUCCESS_UPDATE_MONITOR(100043,"编辑监控成功"),

    FAIL_UPDATE_MONITOR(100044,"编辑监控失败"),

    SUCCESS_PUBLISH_MONITOR(100045,"发布监控成功"),

    FAIL_PUBLISH_MONITOR(100046,"发布监控失败"),

    SUCCESS_DELETE_MONITOR(100047,"删除监控成功"),

    FAIL_DELETE_MONITOR(100048,"删除监控失败"),

    SUCCESS_DISABLE_MONITOR(100049,"禁用监控成功"),

    FAIL_DISABLE_MONITOR(100050,"禁用监控失败"),

    SUCCESS_ENABLE_MONITOR(100049,"启用监控成功"),

    FAIL_ENABLE_MONITOR(100050,"启用监控失败"),

    CODING_REPEAT(100051,"编码重复"),

    PRIMARY_KEY_NOT(100052,"主键不存在"),
    SYS_PROPERTY_ISNULL(100053,"系统属性-PHONE/EMAIL/EMPLOYEECODE为空"),

    BASE_RECEIVE_GROUP_IS_EXITED(100054,"接收组编码已存在"),
    BASE_RECEIVE_GROUP_IS_NOT_EXITED(100055,"接收组不存在"),

    /************************操作日志end******************************/

    FAIL_TO_UPDATE_USER_INFO(10001, "更新用户信息失败");

    private int code;
    private String message;

    CommonErrorCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public String errName() {
        return message;
    }

    @Override
    public int errCode() {
        return code;
    }

    @Override
    public String errMsgTemplate() {
        return null;
    }
}
